function p = lineasConAlmenos( board, fichas )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
    player=1;
    p=0;
    EMPTY=0;
    MAX_GAME=3;
    
    d1=[board(1,1),board(2,2),board(3,3)];
    d2=[board(1,3),board(2,2),board(3,1)];
    
    for i=1:size(board,1)
        f=board(i,:);
        c=board(:,i)';
        
        busy=size(find(f==player),2);
        if(busy==fichas && size(find(f==EMPTY),2)==MAX_GAME-busy)
            p=p+1;
        end
        busy=size(find(c==player),2);
        if(busy==fichas && size(find(c==EMPTY),2)==MAX_GAME-busy)
            p=p+1;
        end
    end
    
    % diagonales
    
    busy=size(find(d1==player),2);
    if(busy==fichas && size(find(d1==EMPTY),2)==MAX_GAME-busy)
        p=p+1;
    end
    busy=size(find(d2==player),2);
    if(busy==fichas && size(find(d2==EMPTY),2)==MAX_GAME-busy)
        p=p+1;
    end


end

